home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / amiga / gui / mui / mui14-dv.lha / MUI / Developer / Modula / txt / MuiSupport.mod < prev   
Encoding:
Modula Implementation  |  1993-10-27  |  1.4 KB  |  71 lines

  1. IMPLEMENTATION MODULE MuiSupport;
  2.  
  3. (*$ NilChk      := FALSE *)
  4. (*$ EntryClear  := FALSE *)
  5. (*$ LargeVars   := FALSE *)
  6. (*$ StackParms  := FALSE *)
  7.  
  8. (* MuiSupport
  9. ** converted by C.Scholz
  10. **
  11. ** HISTORY :
  12. **
  13. ** 22.10.1993 : changed fail, it now does not use anymore Terminal.
  14. **              Instead it uses now Arts.Requester
  15. **              (inspired by Michael Suelman)
  16. *)
  17.  
  18.  
  19. IMPORT R;
  20. IMPORT MD:MuiD;
  21. IMPORT ML:MuiL;
  22. FROM Arts       IMPORT StrPtr, returnVal, Exit, Requester;
  23. FROM SYSTEM     IMPORT ASSEMBLE, ADDRESS, ADR;
  24.  
  25. PROCEDURE DoMethod(obj{R.A2} : APTR; msg{R.A1} : APTR);
  26. (*$ EntryExitCode:=FALSE *)
  27.  
  28. BEGIN
  29.  
  30.     ASSEMBLE (  MOVEA.L -4(A2),  A0
  31.                 MOVE.L   8(A0),-(A7)
  32.                 RTS
  33.                 END );
  34.  
  35. END DoMethod;
  36.  
  37. PROCEDURE DOMethod(obj{R.A2} : APTR; msg{R.A1} : APTR) : LONGINT;
  38. (*$ EntryExitCode:=FALSE *)
  39.  
  40. BEGIN
  41.  
  42.     ASSEMBLE (  MOVEA.L -4(A2),  A0
  43.                 MOVE.L   8(A0),-(A7)
  44.                 RTS
  45.                 END );
  46.  
  47. END DOMethod;
  48.  
  49.  
  50. (*****************)
  51. (* Fail Function *)
  52. (*****************)
  53.  
  54. PROCEDURE fail(app : APTR; str : ARRAY OF CHAR);
  55.  
  56.     VAR
  57.         Result     : BOOLEAN;
  58.  
  59.     BEGIN
  60.         IF app#NIL THEN ML.mDisposeObject(app); END;
  61.  
  62.         IF str[0]#0C THEN
  63.                 Result:=Requester(ADR("MUI-Request"),ADR(str),NIL,ADR("Oh..."));
  64.                 Exit(20);
  65.            ELSE
  66.                 Exit(0);
  67.            END;
  68.     END fail;
  69.  
  70. END MuiSupport.
  71.